package ru.spb.osll.myfit.client.view;

import java.util.HashMap;

import ru.spb.osll.myfit.client.view.IViewManager.ViewType;

public class ViewLoader {
  HashMap<ViewType, IViewManager> managers = new HashMap<IViewManager.ViewType, IViewManager>();

  public ViewLoader() {
    managers.put(ViewType.PAGE_VIEW, new MyFitViewManager());
    managers.put(ViewType.TEST_RESULTS_VIEW, new TestResultsViewManager());
    // managers.put(ViewType.PAGE_EXECUTING_VIEW, value);

  }

  public IView getView(String address) {
    if (address.equals(ViewConstants.TEST_RESULTS_VIEW_NAME)) {
      return managers.get(ViewType.TEST_RESULTS_VIEW).getView(address);
    }
    return managers.get(ViewType.PAGE_VIEW).getView(address);
  }
}
